package com.gitee.wsl.android.ui.recyclerView.adapter.loadstate.viewholder

import android.annotation.SuppressLint
import android.view.View
import android.widget.TextView
import com.gitee.wsl.android.ui.R
import com.gitee.wsl.android.ui.recyclerView.adapter.viewholder.DefaultViewHolderFactoryImp
import com.gitee.wsl.android.ui.recyclerView.adapter.viewholder.ViewHolderAction
import com.gitee.wsl.android.ui.recyclerView.adapter.viewholder.ViewHolderConfig

class LoadStateViewHolder<T : Any,AR: com.gitee.wsl.android.ui.recyclerView.adapter.ActionRepository<T>>: ViewHolderAction<T, AR> {

    override fun onBindViewHolder(
        parent: View,
        position: Int,
        payloads: List<Any>,
        item: T?,
        config: ViewHolderConfig<T, AR>
    ) {
        parent.findViewById<TextView>(R.id.load_state_content).text="load ...."
    }

}

@SuppressLint("ResourceType")
class LoadStateViewHolderFactory<T : Any,AR: com.gitee.wsl.android.ui.recyclerView.adapter.ActionRepository<T>>:
    DefaultViewHolderFactoryImp<T, AR>(
        VIEW_HOLDER_TYPE_LOAD_STATE,R.id.load_state_content,
        LoadStateViewHolder()
    ){

    companion object{
        const val VIEW_HOLDER_TYPE_LOAD_STATE=4651323
    }

}